package tank01;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.IOException;

/**
 * @Auther: xiaofei
 * @Date: 2021/7/1 - 07 - 01 - 11:24
 * @Description: tank01
 * @version: 1.0
 */
//配置资源管理
public class ResouceMgr {
    public static BufferedImage goodTankL = null, goodTankR = null, goodTankU = null, goodTankD = null;
    public static BufferedImage badTankL = null, badTankR = null, badTankU = null, badTankD = null;
    public static BufferedImage bulletL = null, bulletR = null, bulletU = null, bulletD = null;
    public static BufferedImage explode = null;

    static{
        try {
            //goodTankU = ImageIO.read(ResouceMgr.class.getClassLoader().getResourceAsStream("tank01/images/goodTankU.png"));
            //goodTankU = ImageIO.read(ResouceMgr.class.getClassLoader().getResourceAsStream("images/goodTankU.png"));
            //goodTankU = ImageIO.read());
            goodTankU = ImageIO.read(ResouceMgr.class.getResourceAsStream("images/goodTankU.png"));
            goodTankL = ImageUtil.rotateImage(goodTankU,-90);
            goodTankR = ImageUtil.rotateImage(goodTankU,90);
            goodTankD = ImageUtil.rotateImage(goodTankU,180);

            badTankU = ImageIO.read(ResouceMgr.class.getResourceAsStream("images/badTankU.png"));
            badTankL = ImageUtil.rotateImage(badTankU,-90);
            badTankR = ImageUtil.rotateImage(badTankU,90);
            badTankD = ImageUtil.rotateImage(badTankU,180);

            bulletU = ImageIO.read(ResouceMgr.class.getResourceAsStream("images/bulletU.png"));
            bulletL = ImageUtil.rotateImage(bulletU,-90);
            bulletR = ImageUtil.rotateImage(bulletU,90);
            bulletD = ImageUtil.rotateImage(bulletU,180);

            explode = ImageIO.read(ResouceMgr.class.getResourceAsStream("images/explode.png"));
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}
